package com.qinge.blog.service;

import com.github.pagehelper.PageInfo;
import com.qinge.blog.entity.BlogUser;
import com.qinge.blog.vo.paging.PagingReqVO;

import java.util.List;

/**
 * @author QDW
 * @date 2022-05-02 23:38:51
 * @description BlogUser service层类
 */
public interface BlogUserService {

    void add(BlogUser... users);

    void addByList(List<BlogUser> users);

    void removeBatchByIds(List<String> ids);

    void removeById(String id);

    void update(BlogUser user);

    void upsert(BlogUser user);

    BlogUser findById(String id);

    List<BlogUser> findByIds(List<String> ids);

    PageInfo<BlogUser> findAll();

    PageInfo<BlogUser> findAll(PagingReqVO<BlogUser> pagingReqVO);

    PageInfo<BlogUser> paging(PagingReqVO<BlogUser> pagingReqVO);

    /**
     * @param name
     * @return com.qinge.blog.entity.BlogUser
     * @author QDW
     * @date 2022/5/2 23:43
     * @description 根据用户名查找
     **/
    BlogUser findUserByUsername(String name);


    List<String> findRolesByUserId(String userId);


    /**
     * @author QDW
     * @date 2022/5/9 18:22
     * @description 根据用户名或者昵称进行查询
     * @param name
     * @return java.util.List<com.qinge.blog.entity.BlogUser>
     **/
    List<BlogUser> findByName(String name);


    void fillRoles(List<BlogUser> users);
}

